ubuntu xorg.conf for xinerama with a laptop.

chris (2006-05-23 11:20:02)
5441 views
0 replies
Setting up dual screen on a linux system can be a fiddle. I have got it working on a Compaq nc6220 laptop running Ubuntu linux and using Xinerama. Below is a simple cut and paste of my xorg.conf. I have annotated it to show what the various sections are. Hopefully this will be of use to somebody out there who wants two monitors on a single laptop. (ie the laptop TFT and a second desktop TFT).

The end effect is very satisfying - you can drag windows from one screen to the other, or stretch windows between the two screens.

here goes:
# /etc/X11/xorg.conf (xorg X Window System server configuration file)
##
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

# This has been hacked about by chris lacy-hulbert
# This works with xinerama on a Compaq nc6220 running ubuntu Dapper Beta
# Note, no additional packages are required for xinerama to run - all you
# need is to hack your xorg.conf and keep retrying X. I must have restartx
# my X-server at least 50 times in the last few hours :)

# some of these font paths don't actually exist on my system, but I'll leave
# them here to remind me of the fonty goodness which I might enjoy in the future.

Section "Files"
        FontPath        "/usr/share/X11/fonts/misc"
        FontPath        "/usr/share/X11/fonts/cyrillic"
        FontPath        "/usr/share/X11/fonts/100dpi/:unscaled"
        FontPath        "/usr/share/X11/fonts/75dpi/:unscaled"
        FontPath        "/usr/share/X11/fonts/Type1"
        FontPath        "/usr/share/X11/fonts/100dpi"
        FontPath        "/usr/share/X11/fonts/75dpi"
        # path to defoma fonts
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
        Load    "i2c"
        Load    "bitmap"
        Load    "ddc"
        Load    "dri"
        Load    "extmod"
        Load    "freetype"
        Load    "glx"
        Load    "int10"
        Load    "type1"
        Load    "vbe"
EndSection

#
# now tell the X server about my keyboard
# this is unchanged from the original version
# ubuntu is good at building a vanilla xorg.conf
# so you probably won't have to change this bit either
#

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "gb"
EndSection

#
# now details about the mouse
#

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ExplorerPS/2"
        Option          "ZAxisMapping"          "4 5"
        Option          "Emulate3Buttons"       "true"
EndSection

#
# and also the touchpad on the laptop itself
#

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"
EndSection

#
# this is where the video magic comes in. The trick is to make the X-server think
# that you have more than one videocard - ie that you're running dual head.
# I just cut and pasted the Videocard section from my original xorg.conf and
# changed the identifiers as you can see below.
# It doesn't matter what the identifiers are - you could call them vc1 and vc2 
# if you want
#

Section "Device"
        Identifier      "Videocard0"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Screen          0
        Option          "MonitorLayout" "CRT,LFP"
        Option          "AGPMode"    "1"
EndSection

#
# so this is the second video card section - note that the
# PCI bus ID is the same as above, so the kernel will just probe
# out the same device.
#

Section "Device"
        Identifier      "Videocard1"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Screen          1
        Option          "MonitorLayout" "CRT,LFP"
        Option          "AGPMode"    "1"
EndSection

#
# now set up identifiers for the two monitors
#

Section "Monitor"
        Identifier      "Laptop LCD"
        Option          "DPMS"
EndSection

Section "Monitor"
        Identifier      "Desktop LCD"
        Option          "DPMS"
EndSection

#
# A Screen section is made up of an identifier, just to say what this
# screen is called, a Device label to indicate which video card we're
# running off, a Monitor label and then a set of Display subsections.
#
# Note that for xinerama to work on a single head (single video/vga) system,
# the colour depth must be the same for both screens. I am using a colour 
# depth of 24 here
#

Section "Screen"
    Identifier    "Screen0"
    Device        "Videocard1"
    Monitor        "Laptop LCD"
    DefaultDepth    24 
    SubSection "Display"
        Depth        24 
        Modes        "1280x1024" "1024x768"
    EndSubSection
    SubSection "Display"
        Depth        16
        Modes        "1280x1024" "1024x768"
    EndSubSection
    SubSection "Display"
        Depth        24
        Modes        "1280x1024" "1024x768"
    EndSubSection
EndSection

Section "Screen"
        Identifier      "Screen1"
        Device          "Videocard0"
        Monitor         "Desktop LCD"
        DefaultDepth    24
        SubSection "Display"
                Depth           24 
                Modes           "1280x1024"
        EndSubSection
#        SubSection "Display"
#                Depth           4
#                Modes           "1024x768"
#        EndSubSection
EndSection

#
# This is the final section - the Serverlayout defines
# what combination of scerens and input devices I want to use
# note that I have two screens in mine and the second screen ("Screen1")
# is positioned to the Left of the first screen, "screen0" using the
# LeftOf identifier
#

Section "ServerLayout"
    Identifier    "DefaultLayout"
    Screen      0  "Screen0" 0 0
    Screen	1  "Screen1" LeftOf "Screen0"
    InputDevice    "Generic Keyboard"
    InputDevice    "Configured Mouse"
    InputDevice    "Synaptics Touchpad"
    Option        "Xinerama" "On"
    Option        "Clone"    "Off"
EndSection

So that is the completed xorg.conf which I used to set up Xinerama on ubuntu dapper, edgy and feisty.

christo
comment